<?php
class Node extends Module {
    protected $type = '';
    protected $tag = '';
    
    /* --- Actions --- */
    public function act_add() {
        $type = $this->type;
        
        if (empty($type)) tos_die();
        
        $out = out();
        $data = array();
        
        $page_caption = 'Add ' . $this->type;
        $out->add_title($page_caption);
        $data['page_caption'] = $page_caption;
        
        $block_node_edit = tos_view('node/edit', $data);
        $block_content_edit = tos_view("$type/edit", $data);
        
        $block_node_edit->add_block($block_content_edit);
        
        $out->add_block($block_node_edit);
        $out->add_js_script(tos_view('node/edit'));
    }
    /* --- End Actions --- */
}
?>